using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCSEngine.Utils.Entities.Process
{
    public abstract class BaseGameProcessManager : IGameProcessManager
    {
        private ICollection<object> processes = new LinkedList<object>();

        protected ICollection<object> Processes
        {
            get { return processes; }
        }

        public virtual bool AddProcess(object process)
        {
            if (this.IsValidProcess(process) && !this.processes.Contains(process))
            {
                this.processes.Add(process);
                return true;
            }

            return false;
        }

        protected abstract bool IsValidProcess(object process);

        public virtual bool RemoveProcess(object process)
        {
            return this.processes.Remove(process);
        }

        public abstract void Run(Game game, GameTime gameTime);

        public float Priority { get; set; }

        public abstract bool IsDrawProcess { get; }

        public abstract Type ProcessType { get; }

        public virtual void Start(Game game)
        {
        }

        public virtual void Pause(Game game)
        {
        }

        public virtual void Stop(Game game)
        {
        }
    }
}
